angular.module("myApp", ["ui.router", "angularCSS"])
//	.run(["$window", "$rootScope", function($window, $rootScope) {
//		$rootScope.on("$locationChangeSuccess", function() {
//			if ($window.location.href.indexOf("goodsDetail")!= -1) {
//				$rootScope.rootIsFooterShow = false;
//			} else {
//				$rootScope.rootIsFooterShow = true;
//			}
//		})
//	}])
	.config(["$stateProvider", "$urlRouterProvider", function($stateProvider, $urlRouterProvider) {
		$urlRouterProvider.when("", "/home")
		$stateProvider
			.state("home", {
				url: "/home",
				templateUrl: "./view/home.html",
				controller: "HomeCtrl as homeCtrl"
			})
			.state("market", {
				url: "/market",
				templateUrl: "./view/market.html",
				controller: "MarketCtrl as marketCtrl"
			})
			.state("cart", {
				url: "/cart",
				templateUrl: "./view/cart.html",
				controller: "CartCtrl as cartCtrl"
			})
			.state("mine", {
				url: "/mine",
				templateUrl: "./view/mine.html",
				controller: "MineCtrl as mineCtrl"
			})
			.state("goodsDetail", {
				url: "/goodsDetail/:key",
				templateUrl: "./view/goodsDetail.html",
				controller: "DetailCtrl as detailCtrl"
			})
			
	}])

